#region <!--##session ASPXBOEditWholeClass##-->
		/*<!--##
		Entity entity = RepositoryManager.Instance.ActiveEntity;
		<%@EntityIncludes%>
		##-->*/
<%@ Page Language="C#" MasterPageFile="~/DefaultMasterPage.master" AutoEventWireup="true"
			ValidateRequest="false" CodeFile="<!--##=className##-->Edit.aspx.cs" Inherits="<!--##=RepositoryManager.Instance.Repository.ProjectName##-->.Aspx.<!--##=accessorName##-->.<!--##=className##-->Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="Server">

		/*<!--##
		codeGeneratorVariable_DisplayCode.Append(ASPXBOEditJaveScript() + Environment.NewLine);
		codeGeneratorVariable_DisplayCode.Append(ASPXBOEditFrame() + Environment.NewLine);
		##-->*/
</asp:Content>	
<!--##/session##-->
#endregion

#region <!--##session ASPXBOEditFrame##-->
        /*<!--##
		Entity entity = RepositoryManager.Instance.ActiveEntity;
		<%@EntityIncludes%>
		
				
		//overriding entity.
		Entity entityBOPage =  RepositoryManager.Instance.Entities["BOPage",entityName];
		Entity entityBOEditPage =  RepositoryManager.Instance.Entities["BOEditPage",entityName];
		if(entityBOPage != null)
		{
			entityBOPage.OverridingEntity = entityBOEditPage;
		}
		entity.OverridingEntity = entityBOPage;

		##-->*/
    <uasp:Frame runat="server" ID="editFrame" ImageURL="~/images/add-edit.gif" Title="<%$ resources:<!--##=className##-->,EditFrameTitle %>" Width="100%" >
        <uasp:FrameHeader>
            <uasp:FCell>
                <table>
                    <tr>
                        <td>
                            <uasp:ASCXButton ID="btnBackToList" runat="server" Text="Back" NavigateUrl="<!--##=className##-->List.aspx" />
                        </td>
                    </tr>
                </table>
            </uasp:FCell>
        </uasp:FrameHeader>
        <uasp:FRow>
            <uasp:FCell>
            	<asp:ValidationSummary id="vldrSummary" runat="server" HeaderText=""
                    ShowSummary="False" ShowMessageBox="True" ForeColor="#FF0000" />

                <asp:MultiView runat="server" ID="mvMessage" ActiveViewIndex="1">
                    <asp:View runat="server" ID= "viewError">
                        <table width="100%" class="tableError">
                            <tr>
                                <td>
                                    <asp:Label ID="lblError" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                    <asp:View runat="server" ID= "viewInformation">
                        <table width="100%" class="tableInformation">
                            <tr>
                                <td>
                                    <asp:Label ID="lblInformation" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                    </asp:MultiView>
                <table width="100%">
                    <tr>
                    <td rowspan="2" width="1">&nbsp;
                    </td>
                        <td>
                            <br />
                            <uasp:FrameWindow runat="server" ID="editFrameWindow">
        /*<!--##
		int fieldIndex=0;
		int pairsCount=entity.FieldsCountInSingleRow;
		bool isConfimationItration = false;
		while(fieldIndex<entity.SortedFields.Count || isUserRoleClass || isUserLoginClass  )
		{
			
		##-->*/
								<uasp:FRow>
		/*<!--##	
			int i=0;
			for(; i<pairsCount && fieldIndex<entity.SortedFields.Count;)
			{
				Entity.Field entityField = entity.SortedFields[fieldIndex];
				<%@EntityFieldIncludes%>
				if(dataType=="shortbinary" || dataType =="binary" || !displayed)
				{
					//move to next filed but dont increase 'i' pointer 
					fieldIndex++;
					continue;
				}
				else
				{
					//increase 'i' pointer
					i++;
				}
				
				string usedControl = (listTable == string.Empty)? webControl: listControl;
				string suffix = string.Empty;
				string strConfirmation = string.Empty;
				if(entityField.ConfirmationRequired)
				{
					if(isConfimationItration)
					{
						//now it has been consumed.
						fieldIndex++;
						strConfirmation = "Confirmation";
						isConfimationItration = false;
					}
					else
					{
						isConfimationItration = true;
					}
				}
				else
				{
					//it has been consumed.
					fieldIndex++;
				}
				
		##-->*/
									<uasp:WCell CssClass="fwCellCaption" >
                                        <asp:Label ID="lbl<!--##=property##--><!--##=strConfirmation##-->" runat="server" Text="<%$ resources:<!--##=className##-->,Field_<!--##=property##--><!--##=strConfirmation##--> %>"/>
                                    </uasp:WCell>
                                    <uasp:WCell CssClass="fwCellValue" >
                                        <uasp:<!--##=usedControl##--> ID="<!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##--><!--##=strConfirmation##-->" runat="server" <!--##=strIsDecimalNumberAttb##-->  Caption = "<%$ resources:<!--##=className##-->,Field_<!--##=property##--><!--##=strConfirmation##--> %>" IsRequired="<!--##=entityField.Required.ToString().ToLower()##-->" IsReadOnly="<!--##=entityField.ReadOnly.ToString().ToLower()##-->"  <!--##=entityField.ASPXAttributes##-->   />
                                     /*<!--##
                                     if(strConfirmation != string.Empty)
                                     {
                                     ##-->*/   
                                        <uasp:AWCompareValidator Text="*" ID="vldr<!--##=property##-->Confirmation" runat = "server" SetFocusOnError="true" Display="Dynamic" ControlToValidate="<!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##--><!--##=strConfirmation##-->" ControlToCompare = "<!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##-->"></uasp:AWCompareValidator>
									/*<!--##
                                     }
                                     ##-->*/
                                    </uasp:WCell>
                                    			
		/*<!--##	
			}
			if(fieldIndex >= entity.SortedFields.Count && i<pairsCount && (isUserRoleClass || isUserLoginClass ) )
			{
				if(isUserLoginClass)
				{
		##-->*/
									<uasp:WCell>
                                        <asp:Label ID="lblSecurityGroups" runat="server" Text="<%$ resources:GeneralResource,Field_SecurityGroups %>"/>
                                    </uasp:WCell>
                                    <uasp:WCell>
                                        <uasp:ASCXCheckBoxList ID="chkListSecurityGroups" runat="server" Caption = "<%$ resources:GeneralResource,Field_SecurityGroups %>"    />
                                    </uasp:WCell>	
								</uasp:FRow>	
		/*<!--##
					break;
				}
				else if(isUserRoleClass)
				{
		##-->*/
									<uasp:WCell>
                                        <asp:Label ID="lblSecurityModules" runat="server" Text="<%$ resources:GeneralResource,Field_SecurityModules %>"/>
                                    </uasp:WCell>
                                    <uasp:WCell>
										<asp:TreeView ID="tvSecurityModules" runat="server" DataSourceID="smdsSecurityModules"
											 ShowCheckBoxes="All" ShowLines="True" OnTreeNodeDataBound="tvSecurityModules_TreeNodeDataBound">
										</asp:TreeView>
										<script>
                                            //firfox passing passing event arg. so will have to add script block.
                                            document.getElementById('<%= tvSecurityModules.ClientID %>').onclick=InTreeViewCheckAll;										
										</script>

										<asp:SiteMapDataSource ID="smdsSecurityModules" runat="server" SiteMapProvider="SMProvderForConfiguring"
										 ShowStartingNode="False" />
                                    </uasp:WCell>	
								</uasp:FRow>	
		
										
		/*<!--##		
					break;
				} 
			}
		##-->*/	
								</uasp:FRow>	
		/*<!--##
		}
		##-->*/
                            </uasp:FrameWindow>
                        </td>
                    </tr>
                    <tr>
                        <td >
                            <table width="1">
                                <tr>
                                    <td style="width: 100px">
                                        <uasp:ASCXButton ID="btnSave" runat="server" OnClick="btnSave_Click" Text="<%$ resources:GeneralResource,Caption_Save %>" />
                                    </td>
                                    <td style="width: 100px">
                                        <uasp:ASCXButton ID="btnReset" runat="server" Text="<%$ resources:GeneralResource,Caption_Reset %>" OnClientClick="ResetEditPanel()" />
                                    </td>
                                </tr>
                            </table>
                            <br />
                        </td>
                    </tr>
                </table>
            </uasp:FCell>
        </uasp:FRow>
    </uasp:Frame>
<!--##/session##-->
#endregion


#region <!--##session ASPXBOEditJaveScript##-->
        /*<!--##
		Entity entity = RepositoryManager.Instance.ActiveEntity;
		<%@EntityIncludes%>
				
		//overriding entity.
		Entity entityBOPage =  RepositoryManager.Instance.Entities["BOPage",entityName];
		Entity entityBOEditPage =  RepositoryManager.Instance.Entities["BOEditPage",entityName];
		if(entityBOPage != null)
		{
			entityBOPage.OverridingEntity = entityBOEditPage;
		}
		entity.OverridingEntity = entityBOPage;

		##-->*/
		<%--Jave Script--%>
		<script type="text/javascript">
			function ResetEditPanel()
			{
		/*<!--##
        foreach(string entityFieldKey in entity.Fields.Keys)
        {
            Entity.Field entityField = entity.Fields[entityFieldKey];
            <%@EntityFieldIncludes%> 
			if(!displayed)
			{
				continue;
			}
			if(dataType == "shortbinary" || dataType == "binary")
			{
				//will handle it later
				continue;
			}
			string usedControl = (listTable == string.Empty)? webControl: listControl;
			
        ##-->*/
				<%= <!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##-->.ClientID%>.ResetValue();
		/*<!--##
			if(entityField.ConfirmationRequired)
			{
		##-->*/
				<%= <!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##-->Confirmation.ClientID%>.ResetValue();
		/*<!--##	
			}
        }
		##-->*/
			}
		</script>
<!--##/session##-->
#endregion




